import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server:{
    host: '0.0.0.0',
    proxy:{
      '/go1-api':{
        target: "http://localhost:8088",
        changeOrigin:true,
        rewrite: path=>path.replace(/^\/go1-api/,'')
      },
      '/go2-api-user':{
        target: "http://localhost:8089",
        changeOrigin:true,
        rewrite: path=>path.replace(/^\/go2-api-user/,'')
      },
      '/bilibili-api-live':{
        target: "https://api.live.bilibili.com/room/v1/Bg/",
        changeOrigin:true,
        rewrite:path=>path.replace(/^\/bilibli-api-live/,'')
      },
      '/my_service-go1':{
        target: 'http://114.115.168.109:8088/',
        changeOrigin:true,
        rewrite:path=>path.replace(/^\/my_service/,'')
      }
    }
  }
})
